﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Produto.aspx.cs" Inherits="KandieWebProjectI.UI.Forms.ProdutoPages.Produto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <h2>Produtos cadastrados</h2>
    </div>
    <p>
        <a href="ProdutoNovo.aspx" title="Cadastrar novo produto no sistema">Cadastrar novo produto</a>
    </p>

    <div runat="server" id="divGrid">
        <asp:GridView runat="server" ID="gridProdutos" AutoGenerateColumns="false"  
                        AllowPaging="True" PageSize="10"
                        OnPageIndexChanging="GridViewPageIndexChanging"
                        OnRowDeleting="Deletar"
                        OnSelectedIndexChanging="Editar"
                        OnRowDataBound="RowDataBound"
                        ForeColor="#333333" GridLines="None"
                        DataKeyNames="Id" 
                        ShowFooter="True">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775"></AlternatingRowStyle>
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White"/>
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <FooterStyle BackColor="#5D7B9D"></FooterStyle>
            
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Código" InsertVisible="False" 
                    ReadOnly="True" SortExpression="Id">
                    <ItemStyle CssClass="BoundFieldId"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="Descricao" HeaderText="Descricao" SortExpression="Descricao">
                    <ItemStyle CssClass="BoundFieldText"></ItemStyle>
                </asp:BoundField>
                <asp:BoundField DataField="Preco" HeaderText="Preco" SortExpression="Preco">
                </asp:BoundField>
                <asp:CheckBoxField DataField="Ativo" HeaderText="Ativo" SortExpression="Ativo"/>
                <asp:CommandField SelectText="Editar" DeleteText="Deletar" ButtonType="Link"
                    ShowDeleteButton="True" ShowSelectButton="True"/>
            </Columns>
        </asp:GridView>
        
        <% if (gridProdutos.DataSource != null)
           {%>
                <i>Página 
                    <%= gridProdutos.PageIndex + 1%>
                    de
                    <%= gridProdutos.PageCount%>
                </i>
        <% } %>
    </div>
</asp:Content>
